import Vue from 'vue'
import Vuex from 'vuex'
import cookies from "vue-cookies";
Vue.use(Vuex);
Vue.use(cookies);




//cookie保存Boolean会变成字符串，“true”或者“false”。
export default new Vuex.Store({
  state: {
    screen:true,
    dark:cookies.isKey('dark')? cookies.get('dark')=="true" : false,
    background_color: '#ffffff'
    },
  mutations: {
    negate(state){
      state.screen=!state.screen;
    },
    toggleDark(state){
      state.dark=!state.dark;
    }
  },
  actions: {
  },
  modules: {
  }
})
